import {Component, OnInit, ViewChild} from '@angular/core';
import {ConfigService} from '../../services/config.service';
import {Router} from '@angular/router';

@Component({
  selector: 'app-productdetail',
  templateUrl: './productdetail.page.html',
  styleUrls: ['./productdetail.page.scss'],
})
export class ProductdetailPage implements OnInit {
    @ViewChild('content') private content: any;


    slideOpts = {
        initialSlide: 0,
        speed: 400
    };

  constructor(public config:ConfigService
  ,private router:Router) { }

  ngOnInit() {
  }


    segmentChanged(e:any){
    console.dir(e);
    if(e.detail.value=='product'){
        this.content.scrollToTop(300)
    }
    else{
        this.content.scrollToBottom(300)
    }


    }


    addToCart(){
      this.router.navigate(['/tabs/tab2']);



    }


    byImmediately(){

      this.router.navigate(['/order',{"skuid":'skuid'}]);


    }


}
